home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / Fonts.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  8.4 KB  |  316 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Fonts.p
  3.  
  4.      Contains:    Font Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Fonts;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __FONTS__}
  30. {$SETC __FONTS__ := 1}
  31.  
  32. {$I+}
  33. {$SETC FontsIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. CONST
  47.     systemFont                    = 0;
  48.     applFont                    = 1;
  49.     newYork                        = 2;
  50.     geneva                        = 3;
  51.     monaco                        = 4;
  52.     venice                        = 5;
  53.     london                        = 6;
  54.     athens                        = 7;
  55.     sanFran                        = 8;
  56.     toronto                        = 9;
  57.     cairo                        = 11;
  58.     losAngeles                    = 12;
  59.     times                        = 20;
  60.     helvetica                    = 21;
  61.     courier                        = 22;
  62.     symbol                        = 23;
  63.     mobile                        = 24;
  64.     commandMark                    = 17;
  65.     checkMark                    = 18;
  66.     diamondMark                    = 19;
  67.  
  68.     appleMark                    = 20;
  69.     propFont                    = 36864;
  70.     prpFntH                        = 36865;
  71.     prpFntW                        = 36866;
  72.     prpFntHW                    = 36867;
  73.     fixedFont                    = 45056;
  74.     fxdFntH                        = 45057;
  75.     fxdFntW                        = 45058;
  76.     fxdFntHW                    = 45059;
  77.     fontWid                        = 44208;
  78.  
  79.  
  80. TYPE
  81.     FMInput = PACKED RECORD
  82.         family:                    INTEGER;
  83.         size:                    INTEGER;
  84.         face:                    Style;
  85.         needBits:                BOOLEAN;
  86.         device:                    INTEGER;
  87.         numer:                    Point;
  88.         denom:                    Point;
  89.     END;
  90.  
  91.     privateFontResult = Ptr;
  92.  
  93.     FMOutput = PACKED RECORD
  94.         errNum:                    INTEGER;
  95.         fontResult:                privateFontResult;
  96.         boldPixels:                UInt8;
  97.         italicPixels:            UInt8;
  98.         ulOffset:                UInt8;
  99.         ulShadow:                UInt8;
  100.         ulThick:                UInt8;
  101.         shadowPixels:            UInt8;
  102.         extra:                    SInt8;
  103.         ascent:                    UInt8;
  104.         descent:                UInt8;
  105.         widMax:                    UInt8;
  106.         leading:                SInt8;
  107.         curStyle:                SInt8;
  108.         numer:                    Point;
  109.         denom:                    Point;
  110.     END;
  111.  
  112.     FMOutPtr = ^FMOutput;
  113.  
  114.     FontRec = RECORD
  115.         fontType:                INTEGER;                                {font type}
  116.         firstChar:                INTEGER;                                {ASCII code of first character}
  117.         lastChar:                INTEGER;                                {ASCII code of last character}
  118.         widMax:                    INTEGER;                                {maximum character width}
  119.         kernMax:                INTEGER;                                {negative of maximum character kern}
  120.         nDescent:                INTEGER;                                {negative of descent}
  121.         fRectWidth:                INTEGER;                                {width of font rectangle}
  122.         fRectHeight:            INTEGER;                                {height of font rectangle}
  123.         owTLoc:                    INTEGER;                                {offset to offset/width table}
  124.         ascent:                    INTEGER;                                {ascent}
  125.         descent:                INTEGER;                                {descent}
  126.         leading:                INTEGER;                                {leading}
  127.         rowWords:                INTEGER;                                {row width of bit image / 2 }
  128.     END;
  129.  
  130.     FMetricRec = RECORD
  131.         ascent:                    Fixed;                                    {base line to top}
  132.         descent:                Fixed;                                    {base line to bottom}
  133.         leading:                Fixed;                                    {leading between lines}
  134.         widMax:                    Fixed;                                    {maximum character width}
  135.         wTabHandle:                Handle;                                    {handle to font width table}
  136.     END;
  137.  
  138.     FMetricRecPtr = ^FMetricRec;
  139.     FMetricRecHandle = ^FMetricRecPtr;
  140.  
  141.     WidEntry = RECORD
  142.         widStyle:                INTEGER;                                {style entry applies to}
  143.     END;
  144.  
  145.     WidTable = RECORD
  146.         numWidths:                INTEGER;                                {number of entries - 1}
  147.     END;
  148.  
  149.     AsscEntry = RECORD
  150.         fontSize:                INTEGER;
  151.         fontStyle:                INTEGER;
  152.         fontID:                    INTEGER;                                {font resource ID}
  153.     END;
  154.  
  155.     FontAssoc = RECORD
  156.         numAssoc:                INTEGER;                                {number of entries - 1}
  157.     END;
  158.  
  159.     StyleTable = RECORD
  160.         fontClass:                INTEGER;
  161.         offset:                    LONGINT;
  162.         reserved:                LONGINT;
  163.         indexes:                PACKED ARRAY [0..47] OF CHAR;
  164.     END;
  165.  
  166.     NameTable = RECORD
  167.         stringCount:            INTEGER;
  168.         baseFontName:            Str255;
  169.     END;
  170.  
  171.     KernPair = RECORD
  172.         kernFirst:                CHAR;                                    {1st character of kerned pair}
  173.         kernSecond:                CHAR;                                    {2nd character of kerned pair}
  174.         kernWidth:                INTEGER;                                {kerning in 1pt fixed format}
  175.     END;
  176.  
  177.     KernEntry = RECORD
  178.         kernStyle:                INTEGER;                                {style the entry applies to}
  179.         kernLength:                INTEGER;                                {length of this entry}
  180.     END;
  181.  
  182.     KernTable = RECORD
  183.         numKerns:                INTEGER;                                {number of kerning entries}
  184.     END;
  185.  
  186.     WidthTable = PACKED RECORD
  187.         tabData:                ARRAY [0..255] OF Fixed;                {character widths}
  188.         fontResult:                privateFontResult;                        {font record used to build table}
  189.         sExtra:                    LONGINT;                                {space extra used for table}
  190.         style:                    LONGINT;                                {extra due to style}
  191.         fID:                    INTEGER;                                {font family ID}
  192.         fSize:                    INTEGER;                                {font size request}
  193.         face:                    INTEGER;                                {style (face) request}
  194.         device:                    INTEGER;                                {device requested}
  195.         inNumer:                Point;                                    {scale factors requested}
  196.         inDenom:                Point;                                    {scale factors requested}
  197.         aFID:                    INTEGER;                                {actual font family ID for table}
  198.         fHand:                    Handle;                                    {family record used to build up table}
  199.         usedFam:                BOOLEAN;                                {used fixed point family widths}
  200.         aFace:                    UInt8;                                    {actual face produced}
  201.         vOutput:                INTEGER;                                {vertical scale output value}
  202.         hOutput:                INTEGER;                                {horizontal scale output value}
  203.         vFactor:                INTEGER;                                {vertical scale output value}
  204.         hFactor:                INTEGER;                                {horizontal scale output value}
  205.         aSize:                    INTEGER;                                {actual size of actual font used}
  206.         tabSize:                INTEGER;                                {total size of table}
  207.     END;
  208.  
  209.     FamRec = RECORD
  210.         ffFlags:                INTEGER;                                {flags for family}
  211.         ffFamID:                INTEGER;                                {family ID number}
  212.         ffFirstChar:            INTEGER;                                {ASCII code of 1st character}
  213.         ffLastChar:                INTEGER;                                {ASCII code of last character}
  214.         ffAscent:                INTEGER;                                {maximum ascent for 1pt font}
  215.         ffDescent:                INTEGER;                                {maximum descent for 1pt font}
  216.         ffLeading:                INTEGER;                                {maximum leading for 1pt font}
  217.         ffWidMax:                INTEGER;                                {maximum widMax for 1pt font}
  218.         ffWTabOff:                LONGINT;                                {offset to width table}
  219.         ffKernOff:                LONGINT;                                {offset to kerning table}
  220.         ffStylOff:                LONGINT;                                {offset to style mapping table}
  221.         ffProperty:                ARRAY [0..8] OF INTEGER;                {style property info}
  222.         ffIntl:                    ARRAY [0..1] OF INTEGER;                {for international use}
  223.         ffVersion:                INTEGER;                                {version number}
  224.     END;
  225.  
  226.  
  227. PROCEDURE InitFonts;
  228.     {$IFC NOT GENERATINGCFM}
  229.     INLINE $A8FE;
  230.     {$ENDC}
  231. PROCEDURE GetFontName(familyID: INTEGER; VAR name: Str255);
  232.     {$IFC NOT GENERATINGCFM}
  233.     INLINE $A8FF;
  234.     {$ENDC}
  235. PROCEDURE GetFNum(name: ConstStr255Param; VAR familyID: INTEGER);
  236.     {$IFC NOT GENERATINGCFM}
  237.     INLINE $A900;
  238.     {$ENDC}
  239. FUNCTION RealFont(fontNum: INTEGER; size: INTEGER): BOOLEAN;
  240.     {$IFC NOT GENERATINGCFM}
  241.     INLINE $A902;
  242.     {$ENDC}
  243. PROCEDURE SetFontLock(lockFlag: BOOLEAN);
  244.     {$IFC NOT GENERATINGCFM}
  245.     INLINE $A903;
  246.     {$ENDC}
  247. FUNCTION FMSwapFont({CONST}VAR inRec: FMInput): FMOutPtr;
  248.     {$IFC NOT GENERATINGCFM}
  249.     INLINE $A901;
  250.     {$ENDC}
  251. PROCEDURE SetFScaleDisable(fscaleDisable: BOOLEAN);
  252.     {$IFC NOT GENERATINGCFM}
  253.     INLINE $A834;
  254.     {$ENDC}
  255. PROCEDURE FontMetrics(theMetrics: FMetricRecPtr);
  256.     {$IFC NOT GENERATINGCFM}
  257.     INLINE $A835;
  258.     {$ENDC}
  259. PROCEDURE SetFractEnable(fractEnable: BOOLEAN);
  260.     {$IFC NOT GENERATINGCFM}
  261.     INLINE $A814;
  262.     {$ENDC}
  263. FUNCTION GetDefFontSize: INTEGER;
  264.     {$IFC NOT GENERATINGCFM}
  265.     INLINE $3EB8, $0BA8, $6604, $3EBC, $000C;
  266.     {$ENDC}
  267. FUNCTION IsOutline(numer: Point; denom: Point): BOOLEAN;
  268.     {$IFC NOT GENERATINGCFM}
  269.     INLINE $7000, $A854;
  270.     {$ENDC}
  271. PROCEDURE SetOutlinePreferred(outlinePreferred: BOOLEAN);
  272.     {$IFC NOT GENERATINGCFM}
  273.     INLINE $7001, $A854;
  274.     {$ENDC}
  275. FUNCTION GetOutlinePreferred: BOOLEAN;
  276.     {$IFC NOT GENERATINGCFM}
  277.     INLINE $7009, $A854;
  278.     {$ENDC}
  279. FUNCTION OutlineMetrics(byteCount: INTEGER; textPtr: UNIV Ptr; numer: Point; denom: Point; VAR yMax: INTEGER; VAR yMin: INTEGER; awArray: FixedPtr; lsbArray: FixedPtr; boundsArray: RectPtr): OSErr;
  280.     {$IFC NOT GENERATINGCFM}
  281.     INLINE $7008, $A854;
  282.     {$ENDC}
  283. PROCEDURE SetPreserveGlyph(preserveGlyph: BOOLEAN);
  284.     {$IFC NOT GENERATINGCFM}
  285.     INLINE $700A, $A854;
  286.     {$ENDC}
  287. FUNCTION GetPreserveGlyph: BOOLEAN;
  288.     {$IFC NOT GENERATINGCFM}
  289.     INLINE $700B, $A854;
  290.     {$ENDC}
  291. FUNCTION FlushFonts: OSErr;
  292.     {$IFC NOT GENERATINGCFM}
  293.     INLINE $700C, $A854;
  294.     {$ENDC}
  295. FUNCTION GetSysFont : INTEGER;
  296.     {$IFC NOT CFMSYSTEMCALLS}
  297.     INLINE $3EB8, $0BA6;            { MOVE.w $0BA6,(SP) }
  298.     {$ENDC}
  299.  
  300. FUNCTION GetAppFont : INTEGER;
  301.     {$IFC NOT CFMSYSTEMCALLS}
  302.     INLINE $3EB8, $0984;            { MOVE.w $0984,(SP) }
  303.     {$ENDC}
  304.  
  305.  
  306. {$ALIGN RESET}
  307. {$POP}
  308.  
  309. {$SETC UsingIncludes := FontsIncludes}
  310.  
  311. {$ENDC} {__FONTS__}
  312.  
  313. {$IFC NOT UsingIncludes}
  314.  END.
  315. {$ENDC}
  316.